import numpy as np
import matplotlib.pyplot as plt
#随机点
x = np.arange(0,5,0.1)
z = [3+5*x for x in x]
y = [np.random.normal(z,1) for z in z]
#设置显示中文
plt.rcParams['font.family'] = 'SimHei'
#绘图标题
plt.title("这里时标题",fontsize = 20)
plt.xlabel("这里是x轴",fontsize=14)
plt.ylabel("这里是y轴",fontsize=14)

plt.plot(x,y,'bp',label="point")
plt.plot(x,z,'r',label="line")
#这是图例
plt.legend(prop = {"family":"Times New Roman","size":14})
#plt.savefig()   #输出图像
plt.show()